#ifndef LINECHARTWIDGET_H
#define LINECHARTWIDGET_H

#include <QWidget>
#include "datareader.h"

class LineChartWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LineChartWidget(QWidget *parent = nullptr);
    void updateChart(const DataPoint &data);

signals:


private:
    void updateYAxisRange();
    QChart *m_chart;
    QLineSeries *m_lightSeries;    // 光照数据系列
    QLineSeries *m_tempSeries;     // 温度数据系列
    QLineSeries *m_humiditySeries; // 湿度数据系列
    QValueAxis *m_axisX;
    QValueAxis *m_axisY;
    QChartView *m_chartView;

};

#endif // LINECHARTWIDGET_H
